/* jshint indent: 1 */

module.exports = function(sequelize, DataTypes) {
	return sequelize.define('class_course', {
		class_id: {
			type: DataTypes.INTEGER,
			allowNull: false,
			primaryKey: true,
			references: {
				model: {
					tableName: 'class',
				},
				key: 'class_id'
			}
		},
		course_id: {
			type: DataTypes.INTEGER,
			allowNull: false,
			primaryKey: true,
			references: {
				model: {
					tableName: 'course',
				},
				key: 'course_id'
			}
		},
		tea_id: {
			type: DataTypes.INTEGER,
			allowNull: true,
			references: {
				model: {
					tableName: 'teacher',
				},
				key: 'tea_id'
			}
		}
	}, {
		sequelize,
		tableName: 'class_course',
		timestamps: false
	});
};
